/* 移动端基础样式 */
@media screen and (max-width: 768px) {
  /* 容器适配 */
  .app-container {
    padding: 0.5rem;
  }

  /* 头部样式适配 */
  .app-header {
    padding: 0.75rem 1rem;
  }

  .app-title {
    font-size: 1.2rem;
  }

  .header-actions {
    margin-left: 0.5rem;
  }

  /* 搜索框适配 */
  .search-bar {
    margin: 0.5rem;
  }

  .search-input {
    width: 100%;
  }

  /* 表格适配 */
  .data-display {
    margin: 0.5rem;
    border-radius: 8px;
  }

  .el-table {
    font-size: 0.875rem;
  }

  .el-table .cell {
    padding: 8px;
  }

  /* 抽屉适配 */
  .el-drawer {
    width: 90% !important;
  }

  .drawer-title {
    font-size: 1.2rem;
    padding: 0.5rem 0;
  }

  .drawer-content {
    padding: 1rem;
  }

  /* 表单适配 */
  .el-form-item {
    margin-bottom: 1rem;
  }

  .input-unit-width {
    width: 100% !important;
  }

  /* 传感器卡片适配 */
  .sensor-card {
    margin: 0.75rem 0;
    padding: 1rem;
  }

  .sensor-title {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  /* 按钮组适配 */
  .add-sensor-buttons {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .el-button {
    width: 100%;
    margin: 0 !important;
  }

  /* 底部操作栏适配 */
  .drawer-footer {
    padding: 0.75rem 1rem;
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
  }

  /* 分页器适配 */
  .pagination-wrapper {
    padding: 0.5rem;
  }

  .el-pagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* 标签适配 */
  .el-tag {
    margin: 0.25rem;
    font-size: 0.75rem;
  }

  /* 选择框适配 */
  .el-select {
    width: 100%;
  }

  /* 移动端特定优化 */
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  /* 触摸优化 */
  .clickable {
    min-height: 44px;
    min-width: 44px;
  }

  /* 安全区域适配 */
  .safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* 滚动优化 */
  .scroll-container {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
  }

  /* 动画优化 */
  .reduce-animation {
    animation: none !important;
    transition: none !important;
  }

  /* 表单元素优化 */
  input, 
  select, 
  textarea {
    font-size: 16px !important; /* 防止 iOS 自动缩放 */
  }

  /* 弹窗适配 */
  .el-message {
    width: 90%;
    min-width: auto;
  }

  .el-dialog {
    width: 90% !important;
    margin: 10vh auto !important;
  }

  /* 加载状态适配 */
  .loading-mask {
    background: rgba(255, 255, 255, 0.9);
  }

  /* 空状态适配 */
  .empty-state {
    padding: 2rem 1rem;
  }

  /* 错误状态适配 */
  .error-state {
    padding: 1rem;
  }
}

/* 移动端手势支持 */
.touch-feedback {
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s;
}

.touch-feedback:active {
  opacity: 0.7;
}

/* 移动端滑动菜单 */
.swipe-menu {
  position: relative;
  overflow: hidden;
}

/* 移动端底部导航栏 */
.mobile-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 0.5rem 0;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

/* 移动端顶部导航栏 */
.mobile-navbar {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 移动端加载更多 */
.load-more {
  text-align: center;
  padding: 1rem;
  color: #999;
}

/* 移动端下拉刷新 */
.pull-refresh {
  position: relative;
  min-height: 40px;
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
  :root {
    --mobile-bg-color: #121212;
    --mobile-card-bg: #1e1e1e;
    --mobile-text-color: #e0e0e0;
    --mobile-border-color: rgba(255, 255, 255, 0.1);
  }
} 